Model Analyses

These analyses provide further downstream interpretation of models, and often extend them in some way. They also nearly all have associated writing functions for easy output. (See Writer Methods)

SorptionModels.DualModeDesorptionMethod
DualModeDesorption(
    isotherm::IsothermData; 
    [use_fugacity=false], 
    [uncertainty_method=nothing], 
    [naive=false], 
    [share_b=true], 
    [verbose=false]
)

Fit two DualMode models to an isotherm which has both sorbing and desorbing data points.

This function assumes that the isotherm has exactly one sorbing run followed by exactly one desorbing run. Problems may occur if the isotherm does multiple sorbing -> desorbing transitions.

Optional Arguments:

  • use_fugacity: Default: false. Whether or not to fit the models using the isotherms fugacity field rather than pressure.
  • uncertainty_method: Default: nothing. Supports :JackKnife uncertainty.
  • naive: Default: false. If true, will fit the two isotherms completely independently.
  • share_b: Default: true. Whether or not the sorbing and desorbing dual mode models will share an affinity parameter. This reduces the model to 5 total fitted parameters and is presumed to be more physically realistic.
  • verbose: Default: false. If true, will report warnings if some combination of the previous arguments are issue-prone.
source
SorptionModels.WebbIsostericHeatAnalysisType
WebbIsostericHeatAnalysis(isotherms::AbstractVector{<:IsothermData}, [eosmodel=missing]; 
    [model=DualMode()], 
    [num_points=25],
    [use_vant_hoff_constraints=false]
)

Work in progress. Calculate the isosteric heat of sorption ($\Delta{H}_{sorption}$) from a vector of isotherms as a function of concentration using a new derivation that utilizes compressability and molar volume rather than pressure. This derivation is worked out with entropies of sorption in mind, allowing for the calculation of the free energy of sorption given that the entropies are valid.

  • eosmodel: A function that returns compressibility z when supplied a P (MPa) and T (K), i.e., z(P, T). When specified, will use this instead of assuming ideal behavior.
  • If the Dual Mode model is used, use_vant_hoff_constraints will constrain the dual mode fittings with respect to temperature. (see VantHoffDualModeAnalysis)
source
SorptionModels.MobilityFactorAnalysisMethod
MobilityFactorAnalysis(diffusivities::AbstractVector{<:Number}, tfa::ThermodynamicFactorAnalysis)

Deconvolute an isotherm and already-known diffusivity values into their kinetic and thermodynamic components.

Arguments

  • diffusivities::AbstractVector{<:Number}: Vector of diffusivity values in $cm^2/s$
  • tfa::ThermodynamicFactorAnalysis: Already evaluated ThermodynamicFactorAnalysis

See ThermodynamicFactorAnalysis(@ref)

source
SorptionModels.MobilityFactorAnalysisMethod
MobilityFactorAnalysis(diffusivities::AbstractVector{<:Number}, thermo_args...)

Deconvolute an isotherm and already-known diffusivity values into their kinetic and thermodynamic components.

Arguments

  • diffusivities::AbstractVector{<:Number}: Vector of diffusivity values in $cm^2/s$
  • thermo_args...: Arguments that would noramlly be passed to the ThermodynamicFactorAnalysis

See ThermodynamicFactorAnalysis(@ref)

source
SorptionModels.MobilityFactorAnalysisMethod
MobilityFactorAnalysis(isotherm::IsothermData, transient_sorption_models::AbstractVector{<:TransientSorptionModel}, semi_thickness_cm::Number)

Deconvolute a vector of fitted transient sorption models, the corresponding equilibrium isotherm, and the semi-thickness of the polymer sample into a MobilityFactorAnalysis object.

Arguments

  • isotherm::IsothermData: Should be a single-component isotherm. If multiple components are present, only the first component will be deconvoluted.
  • transient_sorption_models::AbstractVector{<:TransientSorptionModel}: Vector of TransientSorptionModel objects. You need at least as many isotherm steps as transients, but you can supply fewer transients if you don't have them for every isotherm step.
  • semi_thickness_cm::Number: Half (semi) thickness of the polymer sample used in the sorption experiment in $cm$.
source
SorptionModels.MolarVolumeAnalysisType
MolarVolumeAnalysis(model::SorptionModel, pressures_mpa, frac_dilations, [uncertainty_method=nothing], [n_interp=30], [n_params=3])

Apply the calculation discussed in

R. Raharjo, B. Freeman, E. Sanders, Pure and mixed gas CH4 and n-C4H10 sorption and dilation in poly(dimethylsiloxane), Journal of Membrane Science. 292 (2007) 45–61. https://doi.org/10.1016/j.memsci.2007.01.012.

to calculate the partial molar volume of a component in a polymer phase.

  • The model in question should take true pressures and not fugacities.

  • The isothermal compressibility factor (units of MPa^-1) is neglected by default. It is used for calculating the change in volume due to external pressure and can generally be neglected for condensible gasses, low pressure liquids, and vapors. For permanent gasses and high pressure liquids, ensure this can be neglected or specify it's value.

  • A modified dual mode model is used to approximate the derivative of the dilation data. If you're uncertainty is very high and you're using :Hessian uncertainties, it's likely you're overfitting and should use :JackKnife instead, as it will more adequately represent the uncertainty in your fit.

  • uncertainty_method

  • n_interp will determine the number of values to interpolate to

  • nparams will specify the number of fitted parameters to use when fitting a continuous dilation function. Currently only 3 and 4 are supported. Start with 3, and if the dilation data is non-monotonic or you're dealing with some difficult data, move to 4. Be aware this will increase the degrees of freedom in the fitting and thus the uncertainty associated with it (see `uncertaintymethod`).

source
SorptionModels.PartialImmobilizationModelMethod
PartialImmobilizationModel(::DualModeModel, ::AbstractVector{<:Number}, ::AbstractVector{<:Number}; [temperature_k])

Apply the method discussed in:

P. Li, T.S. Chung, D.R. Paul, Gas sorption and permeation in PIM-1, Journal of Membrane Science. 432 (2013) 50–57. https://doi.org/10.1016/j.memsci.2013.01.009.

to separate permeabilities into langmuir and henry mode diffusivities given a Dual Mode sorption model.

source
SorptionModels.ThermodynamicFactorAnalysisType
ThermodynamicFactorAnalysis(pressures, model, ρ_pol, mw_pen)

Special case analysis that provides thermodynamic factors implemented by specific sorption models that do not require extra information.

  • TODO citation: We are preparing this type of analysis for publication.

Arguments

  • pressures::AbstractVector: List of pressures (MPa) to evaluate the thermodynamic factor at.

  • model::SorptionModel: SorptionModel that supports thermodynamic_factor.

  • ρ_pol::Number: Polymer density in g/cm3.

  • mw_pwn::Number: Penetrant molecular weight in g/mol.

  • z::AbstractVector: Vector of compressibility factors at the given pressures.

  • if z is not specified, then ideal behavior will be assumed.

source
SorptionModels.ThermodynamicFactorAnalysisMethod
ThermodynamicFactorAnalysis(pressures, ρ_pol, mw_pen, sorptionmodel, activity_function)

Extract the thermodynamic factors of sorption data (see ThermodynamicFactorAnalysis method using an isotherm, sorptionmodel, activity_function). This function allows for manual control of pressures, which is often necessary when using tabulated diffusivities rather than the isotherm's pressures.

Arguments

  • pressures::AbstractVector: List of pressures (MPa) to evaluate the thermodynamic factor at.
  • ρ_pol::Number: Polymer density in g/cm3.
  • mw_pwn::Number: Penetrant molecular weight in g/mol.
  • sorptionmodel::SorptionModel: SorptionModel that supports predict_pressure.
  • activity_function::Function: Function which takes a pressure in MPa and returns an activity.
source
SorptionModels.ThermodynamicFactorAnalysisMethod
ThermodynamicFactorAnalysis(isotherm, sorptionmodel, activity_function)

Extract the thermodynamic factors of an isotherm using analytical derivatives and exact activities from an equation of state (activity_function).

Arguments

  • isotherm::IsothermData: Should be a single-component isotherm. If multiple components are present, only the first component will be used.
  • sorptionmodel::SorptionModel: SorptionModel that supports predict_pressure.
  • activity_function::Function: Function which takes a pressure in MPa and returns an activity.

Isotherms in this function will need pressures, polymer density, and penetrant molecular weight.

  • Concentrations used in this method will be predicted concentrations from the SorptionModel, not tabulated concentrations.
  • The pressures used here will be found in the isotherm, so if you're using this with MobilityFactorAnalysis(@ref), you likely want to specify pressures manually.
source
SorptionModels.VantHoffDualModeAnalysisMethod
VantHoffDualModeAnalysis(isotherms::AbstractVector{<:IsothermData}; use_fugacity=false)

Fit a set of isotherms (using the same gas and polymer) at varying temperatures to the Dual Mode model. If use_fugacity is true, the solver will fit to fugacities within the isotherms rather than pressures.

Returns a VantHoffDualModeModel struct containing contextual information on the fittings. Notable variables within it are:

  • ch0_final: Converged Ch0 value.
  • b0_final: Converged b0 value.
  • kd0_final: Converged kd0 value.
  • mch_final: Converged mch value.
  • ΔHb_final: Converged ΔHb value.
  • ΔHkd_final: Converged ΔHkd value.
  • final_rss: Total sum of squared weighted residuals after convergence.
  • final_models: Vector of Dual Mode models corresponding to the original order of the isotherms given.
  • covariance_matrix: Matrix of covariances between individual parameters above (indexed in the original order they were listed)
source
SorptionModels.ZimmLundbergAnalysisMethod
ZimmLundbergAnalysis(::sorption_model, activities, pen_molar_volume::Number)

Apply the clustering analysis described originally in: B.H. Zimm, J.L. Lundberg, Sorption of Vapors by High Polymers, J. Phys. Chem. 60 (1956) 425–428. https://doi.org/10.1021/j150538a010.

To empirically determine whether clustering occurs in the polymer at given activities.

  • The sorption_model must take activities and return concentration in CC/CC
  • The penetrant molar volume (pen_molar_volume) must be in units of cm^3/mol.
source